define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'live.live_goods/index',
        add_url: 'live.live_goods/add',
        edit_url: 'live.live_goods/edit',
        delete_url: 'live.live_goods/delete',
        export_url: 'live.live_goods/export',
        modify_url: 'live.live_goods/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'live_id', title: '直播间号'},
                    {field: 'goods_id', title: '商品名称',templet:function (res) {
                            return res.liveGoods.goods_name
                        }},
                    {field: 'live_price', title: '直播价格'},
                    {field: 'original_price', title: '商品原价'},
                    {field: 'status', title: '审核状态', templet: ea.table.switch},
                    {field: 'is_show', title: '是否显示', templet: ea.table.switch},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});